from modelscope.pipelines import pipeline
lre_pipeline = pipeline(
    task='speech-language-recognition',
    model='damo/speech_campplus_five_lre_8k',
    model_revision='v1.0.1'
)
example_wav = 'examples/example_lre_mand_8k.wav'
# 识别语种
result = lre_pipeline(example_wav)
print(result)

import librosa

# 加载音频文件
# 'y' 是NumPy数组，'sr' 是采样率
y, sr = librosa.load('examples/example_lre_mand_8k.wav')
result2 = lre_pipeline([y])
print(result2)